<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>sun-earth-moon旋转</title>
    <style>
        body {
            background-color: darkslateblue;
        }
        
        .all {
            position: absolute;
            width: 800px;
            height: 800px;
            left: 30%;
            top: 20px;
            /* border: 1px solid red; */
        }
        
        .sun {
            border: 1px solid orange;
            width: 200px;
            height: 200px;
            background-color: orange;
            border-radius: 100px;
            position: absolute;
            top: 300px;
            left: 300px;
        }
        
        @keyframes first {
            100% {
                transform: rotate(360deg)
            }
        }
        
        @keyframes second {
            100% {
                transform: rotate(360deg)
            }
        }
        
        .travel {
            width: 400px;
            height: 400px;
            /* border: 1px solid red; */
            position: absolute;
            top: 200px;
            left: 200px;
            animation: first 10s;
            animation-iteration-count: infinite;
            animation-timing-function: linear;
        }
        
        .earth-month {
            width: 100px;
            height: 100px;
            /* padding: 20px; */
            /* border: 1px solid white; */
            animation: second 8s;
            animation-iteration-count: infinite;
            animation-timing-function: linear;
        }
        
        .earth {
            width: 100px;
            background-color: blue;
            height: 100px;
            border-radius: 50%;
        }
        
        .moon {
            width: 20px;
            height: 20px;
            border: 1px solid wheat;
            background-color: wheat;
            border-radius: 50%
        }
    </style>
</head>

<body>
    <div class="all">
        <div class="sun"></div>
        <div class="travel">
            <div class="earth-month">
                <div class="earth"></div>
                <div class="moon"></div>
            </div>

        </div>
    </div>
</body>

</html>